package com.nbufe.command.demo3;

/**
 * @Author Zan
 * @Create 2024/6/12 14:20
 * @ClassName: AdderCommand
 * @Description : TODO 请用一句话描述该类的功能
 */
public class AdderCommand extends AbstractCommand {

    private Adder adder = new Adder();

    private int value;

    @Override
    public double compute(int value) {
        this.value = value;
        return adder.add(value);
    }

    @Override
    public double revoke() {
        return adder.add(-value);
    }

    @Override
    public double resume() {
        return adder.add(value);
    }
}
